package com.ht.medicaltreatment.adapter

import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.ht.medicaltreatment.R
import com.ht.medicaltreatment.bean.CheckSampleVO

class NinetySixeAdapter : BaseQuickAdapter<CheckSampleVO,BaseViewHolder>(R.layout.item_96_layout) {
    override fun convert(holder: BaseViewHolder, item: CheckSampleVO) {
        val name = holder.getView<TextView>(R.id.tvName)
        name.text = item.location

        if(item.locationStatus == 0){
            name.setBackgroundResource(R.drawable.shape_96_item_white_bg)
            name.setTextColor(context.getColor(R.color.black))
        }else{
            if(item.checkStatus == 0){
                name.setBackgroundResource(R.drawable.shape_96_item_blue_bg)
                name.setTextColor(context.getColor(R.color.black))
            }else if(item.checkStatus == 1){
                name.setBackgroundResource(R.drawable.shape_96_item_green_bg)
                name.setTextColor(context.getColor(R.color.white))
            }else if(item.checkStatus == 2){
                name.setBackgroundResource(R.drawable.shape_96_item_orange_bg)
                name.setTextColor(context.getColor(R.color.white))
            }
        }
    }
}